import axios from 'axios'
import { ElMessage } from 'element-plus'
const service = axios.create({
  baseURL: process.env.VUE_APP_BASE_API,
  timeout: 5000
})
service.interceptors.request.use((config) => {
  config.headers.icode = ''
  return config
})
service.interceptors.response.use(
  (response) => {
    return response.data
  },
  (err) => {
    ElMessage.error(err.message) // 提示错误消息
    return Promise.reject(err)
  }
)
export default service
